monitor: refactor MonitorHandle
to store dyn object
#3927
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This also alters
VideoMode
to be a regular object and not reference theMonitorHandle
, since it's a static data.Given that
VideoMode
set may change during runtime keeping the reference as a some sort of validity may not be idea and propagating errors when changing video mode could be more reliable.--
I'm not sure that I like how the monitor stuff looks, but I don't have a better idea. Ideally we want to have some sort of
MonitorId
which is more reliable in representing and split theMonitorHandle
intoId
and a way to get the data for the monitor, but I think I'd rather leave it for the future.The
native_id
thing I've moved is already present on all the platforms, so I'd really see why not and usually platforms have some way to address the monitors and backends may build such addressing themselves.It could make sense to change
native_id() -> u64
toMonitorId(u64)
.